<%= javascript_tag "Event.observe(window, 'load', Ledger.load)" %>

<h1>Ledger for <%= h(@account.name) %> held at <%= h(@account.institution) %></h1>

<table id="ledger">
  <thead>
    <tr>
      <th>Date</th>
      <th colspan="2">Payee/Category/Memo</th>
      <th>Debit</th>
      <th>Credit</th>
      <th>Balance</th>
    </tr>
  </thead>
  <tbody id="ledger-body">
    <%= render :partial => 'entry/entry', :collection => @entries %>
  </tbody>
</table>

<%= render :partial => 'entry/new' %>

<hr />

<strong id="balance"><%= @account.balance.format %></strong>

